package com.restkeeper.model;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 读取项目相关配置
 * 
 * @author ruoyi
 */
@Component
public class UploadConfig
{

    /** 上传路径 */
    private static String profile;
    private static String profileVoice;

    @Value("${upload.profile}")
    public void setProfile(String profile) {
        UploadConfig.profile = profile;
    }

    @Value("${upload.profile_voice}")
    public void setProfileVoice(String profileVoice) {
        UploadConfig.profileVoice = profileVoice;
    }


    public static String getProfile()
    {
        return profile;
    }
    public static String getProfileVoice()
    {
        return profileVoice;
    }

    /**
     * 获取导入上传路径
     */
    public static String getImportPath()
    {
        return getProfile() + "/import";
    }

    /**
     * 获取头像上传路径
     */
    public static String getAvatarPath()
    {
        return getProfile() + "/avatar";
    }

    /**
     * 获取下载路径
     */
    public static String getDownloadPath()
    {
        return getProfile() + "/download/";
    }

    /**
     * 获取上传路径
     */
    public static String getUploadPath()
    {
        return getProfile() + "/upload";
    }
}
